# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=libplacebo
pkgver=5.229.2
pkgrel=2
pkgdesc='Reusable library for GPU-accelerated video/image rendering primitives'
url='https://github.com/haasn/libplacebo'
arch=('x86_64')
license=('LGPL2.1')
depends=('vulkan-icd-loader' 'libvulkan.so' 'glslang' 'lcms2' 'liblcms2.so' 'shaderc' 'libshaderc_shared.so'
         'glibc' 'gcc-libs' 'libunwind')
makedepends=(
  'meson' 'ninja' 'vulkan-headers' 'glad' 'nuklear'
  'python' 'python-setuptools' 'python-mako' 'python-markupsafe' 'python-jinja'
)
provides=('libplacebo.so')
source=(https://code.videolan.org/videolan/libplacebo/-/archive/v${pkgver}/libplacebo-v${pkgver}.tar.gz)
sha512sums=('56723bb3df4229ecaa61189080f108ac7c953b435b9969f7fe85835eeaca88ee8ec90ef9dfdd5e99e92d4cccea5b8e24c676d3b318ab8e22ead09c003b3c6165')
b2sums=('d828cf97713a9d46c983da111c5400487d02e9c3d8ec874de67d9f9d753508e7dc941cfdcdd024e78ea7e08e0f3d6a71b82f92e3478ed9d8a8cadbc86462b236')

build() {
  cd ${pkgbase}-v${pkgver}
  CXXFLAGS+=" -I/usr/include/glslang"
  arch-meson build \
    -D tests=true \
    -D vulkan=enabled \
    -D glslang=enabled \
    -D shaderc=enabled \
    -D lcms=enabled \
    -D d3d11=disabled \
    -D demos=false
  ninja -C build
}

check() {
  cd ${pkgbase}-v${pkgver}
  ninja -C build test
}

package() {
  cd ${pkgbase}-v${pkgver}
  DESTDIR="${pkgdir}" ninja -C build install
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
